/*
 * CmdLineParser.cpp
 *
 *  Created on: 20/05/2010
 *      Author: lea87crzz
 */

#include "CmdLineParser.h"
#include <string>
#include <iostream>

using namespace std;

int CmdLineParser::Parse(int argc, char**argv)
{
	if(argc<3)
		return -1;
	if(argc==3)//deberia ser "-l"
	{
		if(((string)argv[1])!="-l") return -1;
	}
	if(argc>3 && (string)argv[1]!="-a" && (string)argv[1]!="-x" && (string)argv[1]!="-d")
		return -1;
	string ultimoArg(argv[argc-1]);
	unsigned int t=ultimoArg.length();
	if(ultimoArg.rfind(".lzp")!=t-4)
		return -1;
	return 0;
}
